Hypertext Transfer Protocol (HTTP) is an application-level protocol for retrieving interlinked resources, such as webpages, on the World Wide Web. HTTP specifies the standard for requests and responses between a client and a server. Examples of HTTP clients include web browsers, web crawlers, and other end-user software tools that make requests on behalf of users in accordance with the HTTP standard. Examples of HTTP servers include web servers hosting webpages and servers of other internet resources that respond to HTTP requests.
Typically, when an HTTP client initiates an HTTP request, it first establishes a Transmission Control Protocol (TCP) connection to a dedicated port on an HTTP server. TCP connection establishment uses a three-way handshake. First the client initiates the connection establishment by sending a connection request (e.g., in a SYN packet) to the server. In response, the server replies with an acknowledgement of the connection request (e.g., a SYN-ACK packet). Finally, the client sends an acknowledgement (e.g., an ACK packet) back to the server for the receipt of the server's acknowledgement. At this point, the TCP connection between the client and the server is established, and the client and server can begin data transfer to each other through the established TCP connection.
In contrast to TCP, User Datagram Protocol (UDP) is a message-based connectionless protocol that does not require hand-shaking dialogues for guaranteeing reliability, ordering, or data integrity. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver.